﻿package cn.antscript.airCMS.data 
{
	import cn.antscript.airCMS.data.singleData.FileData;
	/**
	 * ...
	 * @author 
	 */
	public class FilesData implements IGroupBtn 
	{
			
		public var allowDel:Boolean;
		public var container:Vector.<FileData>;
		public var label:String;
		public function FilesData(xml:XML) 
		{
			// xml data structure
			//<files label="" allowDel="">
				//<file label="" txt="" url="" timestamp="" />
				//<file label="" txt="" url="" timestamp="" />
				//<file label="" txt="" url="" timestamp="" />
			//</files>
			
			allowDel = String(xml.@allowDel) == "1";
			label = String(xml.@label);
			var data:FileData;
			container = new Vector.<FileData>();
			for (var i:int = 0; i < xml.file.length(); i++) 
			{
				data = new FileData(	String(xml.file[i].@id),
										String(xml.file[i].@label),
										String(xml.file[i].@content),
										String(xml.file[i].@url),
										String(xml.file[i].@timestamp));
				container.push(data);				
			}
		}
		
	}

}